package com.ghy.www.my.loadbalance.consumer.javaconfig;

import com.ghy.www.api.IService1;
import com.ghy.www.api.IService2;
import com.ghy.www.api.IService3;
import com.ghy.www.api.IService4;
import org.apache.dubbo.common.constants.LoadbalanceRules;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.context.annotation.Configuration;

@Configuration
public class JavaConfigDubbo {
    @DubboReference(loadbalance = LoadbalanceRules.RANDOM)
    private IService1 iService1;

    @DubboReference(loadbalance = LoadbalanceRules.ROUND_ROBIN)
    private IService2 iService2;

    @DubboReference(loadbalance = LoadbalanceRules.LEAST_ACTIVE)
    private IService3 iService3;

    @DubboReference(loadbalance = LoadbalanceRules.CONSISTENT_HASH, parameters = {"hash.arguments=0"})
    private IService4 iService4;
}
